import React from 'react';
import ReactDOM from 'react-dom/client';
import { Provider } from 'react-redux';
import { PersistGate } from 'redux-persist/lib/integration/react';
import { persist, store } from '@/store';
import App from '@/App';

const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
store.subscribe(() => {
  root.render(
    <Provider store={store}>
      <PersistGate loading={null} persistor={persist}>
        <App />
      </PersistGate>
    </Provider>,
  );
});
